Convert a Set of Tests from an Older Version to the Current Version
Source code
'************************************************************************************************************************
'Description:
'
'This example specifies a folder in which tests from an older version are
'stored and then loops through each test in the folder (and its subfolders) to open
'each one and save it in the current version format.
'
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim filesys
Dim maindir
Dim testCol
Dim checkfolder

' Create the QuickTest.Application object that represents UFT One
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True

' Get the collection of test scripts
Set filesys = CreateObject("Scripting.FileSystemObject")

' TO DO: Specify the test script directory....
Set maindir = filesys.GetFolder("C:\temp")
Set testCol = maindir.SubFolders

' Loop through each test in the collection
For Each fl In testCol

    ' Verify the folder is a UFT One test
    checkfolder = fl.Path & "\Action0"
    If (filesys.FolderExists(checkfolder)) Then ' The folder is a UFT One test folder

       ' Convert test
       qtApp.Open fl.Path, False, False

       ' wscript.sleep 1000

       ' Save converted test
       qtApp.Test.Save

    End If
Next

qtApp.Quit

' Release the File System Objects
Set testCol = Nothing
Set maindir = Nothing
Set filesys = Nothing

' Release the QuickTest.Application object
Set qtApp = Nothing